package xin.lhuo.we.server.entity;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.util.List;

/**
 * @author Lhuo
 * @date 2019/5/23 17:49
 */
@Getter
@Setter
@ToString
public class CaiYunSimpleWeather {
    private String status;
    private String lang;
    private ResultBean result;
    private int server_time;
    private String api_status;
    private int tzshift;
    private String api_version;
    private String timezone;
    private String unit;
    private List<Double> location;

    @Getter
    @Setter
    @ToString
    public static class ResultBean {
        private int primary;
        private DailyBean daily;

        @Getter
        @Setter
        @ToString
        public static class DailyBean {
            private String status;
            private AirQualityBean air_quality;
            private List<TemperatureBean> temperature;
            private List<SkyconBean> skycon;


            @Getter
            @Setter
            @ToString
            public static class AirQualityBean {
                private List<AqiBean> aqi;

                @Getter
                @Setter
                @ToString
                public static class AqiBean {
                    /**
                     * Aqi
                     * <p>
                     * date : 2019-05-23T00:00+08:00
                     * max : {"usa":50,"chn":50}
                     * avg : {"usa":38,"chn":38}
                     * min : {"usa":26,"chn":26}
                     */

                    private String date;
                    private MaxBean max;
                    private AvgBean avg;
                    private MinBean min;

                    @Getter
                    @Setter
                    @ToString
                    public static class MaxBean {
                        private int chn;
                    }

                    @Getter
                    @Setter
                    @ToString
                    public static class AvgBean {
                        private double chn;
                    }

                    @Getter
                    @Setter
                    @ToString
                    public static class MinBean {
                        private int chn;
                    }
                }
            }

            @Getter
            @Setter
            @ToString
            public static class TemperatureBean {
                /**
                 * 温度
                 * <p>
                 * date : 2019-05-23T00:00+08:00
                 * max : 25.0
                 * avg : 22.83
                 * min : 21.0
                 */

                private String date;
                private double max;
                private double avg;
                private double min;
            }


            @Getter
            @Setter
            @ToString
            public static class SkyconBean {
                /**
                 * 全天主要天气现象
                 * <p>
                 * date : 2019-05-23T00:00+08:00
                 * value : CLEAR_NIGHT
                 */

                private String date;
                private String value;
            }
        }
    }
}
